<br>
<h2>编辑帖子</h2>

<% form_for(@post) do |f| %>
  <%= f.error_messages %>
  <p>
    <%= f.label :title %><br />
    <%= f.text_field :title %>
  </p>
  <p>
    <%= f.label :body %><br />
    <%= f.text_area :body %>
  </p>
  <p>
    <%= f.label :published %><br />
    <%= f.check_box :published %>
  </p>
  <p>
    <%= f.label :close_comment %><br />
    <%= f.check_box :close_comment %>
  </p>
  
  <p>
    <%= f.label :category_id %><br />
    <%= f.select :category_id, @categories %>
  </p>
  <p>
    <%= f.label :tag_id %><br />
    <%= f.text_field :tag_id %>
  </p>
  <p>
    <%= f.submit "确定" %>
  </p>

<% end %>

<%= link_to '显示', admin_post_path(@post) %> |
<%= link_to '回到帖子列表', admin_posts_path %>
